home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr48 / mcedit10.zip / MCEDEMO.PAS < prev    next >
Pascal/Delphi Source File  |  1993-04-19  |  41KB  |  1,407 lines

  1. program mcedemo;  { A demo program showing some of the things you can
  2.                     do with a mouse. }
  3.  
  4. uses crt, graph, dos, bobmouse;
  5.  
  6. const
  7.   title = 'MOUSE CURSOR EDITOR DEMO - Written by Bob Hayes, December 1, 1991';
  8.  
  9. var
  10.   sysgraphadapter, sysgraphmode : integer;
  11.   graphdriver, graphmode : integer;
  12.   quit,right,both,left : boolean;
  13.   SIZE,pointerX, pointerY : word;
  14.   x,y,P,D, c2,i,x1,y1,x2,y2 : integer;
  15.   ch : char;
  16.   POINT : POINTER;
  17.   exitsave, bobsignp : pointer;
  18.   black, white, ltgray, dkgray, ltgreen : integer;
  19.   mx,my : word;
  20.   lb,rb,bb : boolean;
  21.   continue : boolean;
  22.  
  23. {--------------------------------------------------------------------------}
  24.  
  25. { This is the programs exit procedure.  It is called when the program
  26.   terminates, normally or because or a runtime error.  In this case
  27.   it insures the the user is not left in a graphics screen or with the
  28.   mouse. }
  29.  
  30. {$F+}
  31. procedure mcedemoexit;
  32. begin
  33.   exitproc := exitsave;
  34.   hidemouse;
  35.   closegraph;
  36.   textbackground(0);
  37.   textcolor(7);
  38.   writeln('The End.');
  39.   writeln;
  40. end;
  41. {$F-}
  42.  
  43. {--------------------------------------------------------------------------}
  44.  
  45. { Include the various cursor files. }
  46.  
  47. {$I default.pas}
  48. {$I black.pas}
  49. {$I hand.pas}
  50. {$I handscan.pas}
  51. {$I horsize.pas}
  52. {$I vertsize.pas}
  53. {$I textt.pas}
  54. {$I magglass.pas}
  55. {$I hourglas.pas}
  56. {$I inverse.pas}
  57. {$I seethrgh.pas}
  58.  
  59. {--------------------------------------------------------------------------}
  60.  
  61. { Link signature image. }
  62. {$L bobsign.obj}
  63. procedure bobsign; external;
  64.  
  65. { bobsign.obj contains a bitmap of my signiture in the form that TP can
  66.   place using the PutImage procedure.  If you are interested in linking
  67.   bitmaps into your programs, drop my a line, I have written a utility
  68.   that converts PCX files into this Borland image format.}
  69.  
  70. {--------------------------------------------------------------------------}
  71.  
  72. PROCEDURE Mouse1;
  73.  
  74. { Mouse1 to Mouse12 contain procedures, output by MCEDIT, for the cursor
  75.   animation demo. }
  76.  
  77. var
  78.   mm1masks : array[0..1,0..15] of word;
  79.   Regs : Registers;
  80.  
  81. BEGIN
  82.  
  83. { Screen Mask }
  84.  
  85.   mm1masks[0,0] := $F81F;    {1111100000011111}
  86.   mm1masks[0,1] := $E007;    {1110000000000111}
  87.   mm1masks[0,2] := $C003;    {1100000000000011}
  88.   mm1masks[0,3] := $8001;    {1000000000000001}
  89.   mm1masks[0,4] := $0000;    {0000000000000000}
  90.   mm1masks[0,5] := $0000;    {0000000000000000}
  91.   mm1masks[0,6] := $0000;    {0000000000000000}
  92.   mm1masks[0,7] := $0000;    {0000000000000000}
  93.   mm1masks[0,8] := $0000;    {0000000000000000}
  94.   mm1masks[0,9] := $8001;    {1000000000000001}
  95.   mm1masks[0,10] := $C003;   {1100000000000011}
  96.   mm1masks[0,11] := $E007;   {1110000000000111}
  97.   mm1masks[0,12] := $F81F;   {1111100000011111}
  98.   mm1masks[0,13] := $FFFF;   {1111111111111111}
  99.   mm1masks[0,14] := $FFFF;   {1111111111111111}
  100.   mm1masks[0,15] := $FFFF;   {1111111111111111}
  101.  
  102. { Cursor Mask }
  103.  
  104.   mm1masks[1,0] := $0000;    {0000000000000000}
  105.   mm1masks[1,1] := $07E0;    {0000011111100000}
  106.   mm1masks[1,2] := $1FE8;    {0001111111101000}
  107.   mm1masks[1,3] := $3FDC;    {0011111111011100}
  108.   mm1masks[1,4] := $7E5E;    {0111111001011110}
  109.   mm1masks[1,5] := $7E3E;    {0111111000111110}
  110.   mm1masks[1,6] := $7E3E;    {0111111000111110}
  111.   mm1masks[1,7] := $7E7E;    {0111111001111110}
  112.   mm1masks[1,8] := $7FFE;    {0111111111111110}
  113.   mm1masks[1,9] := $3FFC;    {0011111111111100}
  114.   mm1masks[1,10] := $1FF8;   {0001111111111000}
  115.   mm1masks[1,11] := $07E0;   {0000011111100000}
  116.   mm1masks[1,12] := $0000;   {0000000000000000}
  117.   mm1masks[1,13] := $0000;   {0000000000000000}
  118.   mm1masks[1,14] := $0000;   {0000000000000000}
  119.   mm1masks[1,15] := $0000;   {0000000000000000}
  120.   regs.AX := 9;
  121.   regs.BX := 1;
  122.   regs.CX := 0;
  123.   regs.DX := ofs(mm1masks);
  124.   regs.ES := seg(mm1masks);
  125.   Intr(51,Regs);
  126. end;
  127.  
  128. {--------------------------------------------------------------------------}
  129.  
  130. PROCEDURE Mouse2;
  131.  
  132. var
  133.   m2masks : array[0..1,0..15] of word;
  134.   Regs : Registers;
  135.  
  136. BEGIN
  137.  
  138. { Screen Mask }
  139.  
  140.   m2masks[0,0] := $F81F;    {1111100000011111}
  141.   m2masks[0,1] := $E007;    {1110000000000111}
  142.   m2masks[0,2] := $C003;    {1100000000000011}
  143.   m2masks[0,3] := $8001;    {1000000000000001}
  144.   m2masks[0,4] := $0000;    {0000000000000000}
  145.   m2masks[0,5] := $0000;    {0000000000000000}
  146.   m2masks[0,6] := $0000;    {0000000000000000}
  147.   m2masks[0,7] := $0000;    {0000000000000000}
  148.   m2masks[0,8] := $0000;    {0000000000000000}
  149.   m2masks[0,9] := $8001;    {1000000000000001}
  150.   m2masks[0,10] := $C003;   {1100000000000011}
  151.   m2masks[0,11] := $E007;   {1110000000000111}
  152.   m2masks[0,12] := $F81F;   {1111100000011111}
  153.   m2masks[0,13] := $FFFF;   {1111111111111111}
  154.   m2masks[0,14] := $FFFF;   {1111111111111111}
  155.   m2masks[0,15] := $FFFF;   {1111111111111111}
  156.  
  157. { Cursor Mask }
  158.  
  159.   m2masks[1,0] := $0000;    {0000000000000000}
  160.   m2masks[1,1] := $07E0;    {0000011111100000}
  161.   m2masks[1,2] := $1FF8;    {0001111111111000}
  162.   m2masks[1,3] := $3FFC;    {0011111111111100}
  163.   m2masks[1,4] := $7E72;    {0111111001110010}
  164.   m2masks[1,5] := $7E4E;    {0111111001001110}
  165.   m2masks[1,6] := $7E3E;    {0111111000111110}
  166.   m2masks[1,7] := $7E7E;    {0111111001111110}
  167.   m2masks[1,8] := $7FFE;    {0111111111111110}
  168.   m2masks[1,9] := $3FFC;    {0011111111111100}
  169.   m2masks[1,10] := $1FF8;   {0001111111111000}
  170.   m2masks[1,11] := $07E0;   {0000011111100000}
  171.   m2masks[1,12] := $0000;   {0000000000000000}
  172.   m2masks[1,13] := $0000;   {0000000000000000}
  173.   m2masks[1,14] := $0000;   {0000000000000000}
  174.   m2masks[1,15] := $0000;   {0000000000000000}
  175.   regs.AX := 9;
  176.   regs.BX := 1;
  177.   regs.CX := 0;
  178.   regs.DX := ofs(m2masks);
  179.   regs.ES := seg(m2masks);
  180.   Intr(51,Regs);
  181. end;
  182.  
  183. {--------------------------------------------------------------------------}
  184.  
  185. PROCEDURE Mouse3;
  186.  
  187. var
  188.   m3masks : array[0..1,0..15] of word;
  189.   Regs : Registers;
  190.  
  191. BEGIN
  192.  
  193. { Screen Mask }
  194.  
  195.   m3masks[0,0] := $F81F;    {1111100000011111}
  196.   m3masks[0,1] := $E007;    {1110000000000111}
  197.   m3masks[0,2] := $C003;    {1100000000000011}
  198.   m3masks[0,3] := $8001;    {1000000000000001}
  199.   m3masks[0,4] := $0000;    {0000000000000000}
  200.   m3masks[0,5] := $0000;    {0000000000000000}
  201.   m3masks[0,6] := $0000;    {0000000000000000}
  202.   m3masks[0,7] := $0000;    {0000000000000000}
  203.   m3masks[0,8] := $0000;    {0000000000000000}
  204.   m3masks[0,9] := $8001;    {1000000000000001}
  205.   m3masks[0,10] := $C003;   {1100000000000011}
  206.   m3masks[0,11] := $E007;   {1110000000000111}
  207.   m3masks[0,12] := $F81F;   {1111100000011111}
  208.   m3masks[0,13] := $FFFF;   {1111111111111111}
  209.   m3masks[0,14] := $FFFF;   {1111111111111111}
  210.   m3masks[0,15] := $FFFF;   {1111111111111111}
  211.  
  212. { Cursor Mask }
  213.  
  214.   m3masks[1,0] := $0000;    {0000000000000000}
  215.   m3masks[1,1] := $07E0;    {0000011111100000}
  216.   m3masks[1,2] := $1FF8;    {0001111111111000}
  217.   m3masks[1,3] := $3FFC;    {0011111111111100}
  218.   m3masks[1,4] := $7E7E;    {0111111001111110}
  219.   m3masks[1,5] := $7E7E;    {0111111001111110}
  220.   m3masks[1,6] := $7E00;    {0111111000000000}
  221.   m3masks[1,7] := $7E7E;    {0111111001111110}
  222.   m3masks[1,8] := $7FFE;    {0111111111111110}
  223.   m3masks[1,9] := $3FFC;    {0011111111111100}
  224.   m3masks[1,10] := $1FF8;   {0001111111111000}
  225.   m3masks[1,11] := $07E0;   {0000011111100000}
  226.   m3masks[1,12] := $0000;   {0000000000000000}
  227.   m3masks[1,13] := $0000;   {0000000000000000}
  228.   m3masks[1,14] := $0000;   {0000000000000000}
  229.   m3masks[1,15] := $0000;   {0000000000000000}
  230.   regs.AX := 9;
  231.   regs.BX := 1;
  232.   regs.CX := 0;
  233.   regs.DX := ofs(m3masks);
  234.   regs.ES := seg(m3masks);
  235.   Intr(51,Regs);
  236. end;
  237.  
  238. {--------------------------------------------------------------------------}
  239.  
  240. PROCEDURE Mouse4;
  241.  
  242. var
  243.   m4masks : array[0..1,0..15] of word;
  244.   Regs : Registers;
  245.  
  246. BEGIN
  247.  
  248. { Screen Mask }
  249.  
  250.   m4masks[0,0] := $F81F;    {1111100000011111}
  251.   m4masks[0,1] := $E007;    {1110000000000111}
  252.   m4masks[0,2] := $C003;    {1100000000000011}
  253.   m4masks[0,3] := $8001;    {1000000000000001}
  254.   m4masks[0,4] := $0000;    {0000000000000000}
  255.   m4masks[0,5] := $0000;    {0000000000000000}
  256.   m4masks[0,6] := $0000;    {0000000000000000}
  257.   m4masks[0,7] := $0000;    {0000000000000000}
  258.   m4masks[0,8] := $0000;    {0000000000000000}
  259.   m4masks[0,9] := $8001;    {1000000000000001}
  260.   m4masks[0,10] := $C003;   {1100000000000011}
  261.   m4masks[0,11] := $E007;   {1110000000000111}
  262.   m4masks[0,12] := $F81F;   {1111100000011111}
  263.   m4masks[0,13] := $FFFF;   {1111111111111111}
  264.   m4masks[0,14] := $FFFF;   {1111111111111111}
  265.   m4masks[0,15] := $FFFF;   {1111111111111111}
  266.  
  267. { Cursor Mask }
  268.   m4masks[1,0] := $0000;    {0000000000000000}
  269.   m4masks[1,1] := $07E0;    {0000011111100000}
  270.   m4masks[1,2] := $1FF8;    {0001111111111000}
  271.   m4masks[1,3] := $3FFC;    {0011111111111100}
  272.   m4masks[1,4] := $7E7E;    {0111111001111110}
  273.   m4masks[1,5] := $7E7E;    {0111111001111110}
  274.   m4masks[1,6] := $7E7E;    {0111111001111110}
  275.   m4masks[1,7] := $7E1E;    {0111111000011110}
  276.   m4masks[1,8] := $7FE6;    {0111111111100110}
  277.   m4masks[1,9] := $3FF8;    {0011111111111000}
  278.   m4masks[1,10] := $1FF8;   {0001111111111000}
  279.   m4masks[1,11] := $07E0;   {0000011111100000}
  280.   m4masks[1,12] := $0000;   {0000000000000000}
  281.   m4masks[1,13] := $0000;   {0000000000000000}
  282.   m4masks[1,14] := $0000;   {0000000000000000}
  283.   m4masks[1,15] := $0000;   {0000000000000000}
  284.   regs.AX := 9;
  285.   regs.BX := 1;
  286.   regs.CX := 0;
  287.   regs.DX := ofs(m4masks);
  288.   regs.ES := seg(m4masks);
  289.   Intr(51,Regs);
  290. end;
  291.  
  292. {--------------------------------------------------------------------------}
  293.  
  294. PROCEDURE Mouse5;
  295.  
  296. var
  297.   m5masks : array[0..1,0..15] of word;
  298.   Regs : Registers;
  299.  
  300. BEGIN
  301.  
  302. { Screen Mask }
  303.  
  304.   m5masks[0,0] := $F81F;    {1111100000011111}
  305.   m5masks[0,1] := $E007;    {1110000000000111}
  306.   m5masks[0,2] := $C003;    {1100000000000011}
  307.   m5masks[0,3] := $8001;    {1000000000000001}
  308.   m5masks[0,4] := $0000;    {0000000000000000}
  309.   m5masks[0,5] := $0000;    {0000000000000000}
  310.   m5masks[0,6] := $0000;    {0000000000000000}
  311.   m5masks[0,7] := $0000;    {0000000000000000}
  312.   m5masks[0,8] := $0000;    {0000000000000000}
  313.   m5masks[0,9] := $8001;    {1000000000000001}
  314.   m5masks[0,10] := $C003;   {1100000000000011}
  315.   m5masks[0,11] := $E007;   {1110000000000111}
  316.   m5masks[0,12] := $F81F;   {1111100000011111}
  317.   m5masks[0,13] := $FFFF;   {1111111111111111}
  318.   m5masks[0,14] := $FFFF;   {1111111111111111}
  319.   m5masks[0,15] := $FFFF;   {1111111111111111}
  320.  
  321. { Cursor Mask }
  322.  
  323.   m5masks[1,0] := $0000;    {0000000000000000}
  324.   m5masks[1,1] := $07E0;    {0000011111100000}
  325.   m5masks[1,2] := $1FF8;    {0001111111111000}
  326.   m5masks[1,3] := $3FFC;    {0011111111111100}
  327.   m5masks[1,4] := $7E7E;    {0111111001111110}
  328.   m5masks[1,5] := $7E7E;    {0111111001111110}
  329.   m5masks[1,6] := $7E7E;    {0111111001111110}
  330.   m5masks[1,7] := $7E7E;    {0111111001111110}
  331.   m5masks[1,8] := $7FBE;    {0111111110111110}
  332.   m5masks[1,9] := $3FDC;    {0011111111011100}
  333.   m5masks[1,10] := $1FD8;   {0001111111011000}
  334.   m5masks[1,11] := $07E0;   {0000011111100000}
  335.   m5masks[1,12] := $0000;   {0000000000000000}
  336.   m5masks[1,13] := $0000;   {0000000000000000}
  337.   m5masks[1,14] := $0000;   {0000000000000000}
  338.   m5masks[1,15] := $0000;   {0000000000000000}
  339.   regs.AX := 9;
  340.   regs.BX := 1;
  341.   regs.CX := 0;
  342.   regs.DX := ofs(m5masks);
  343.   regs.ES := seg(m5masks);
  344.   Intr(51,Regs);
  345. end;
  346.  
  347. {--------------------------------------------------------------------------}
  348.  
  349. PROCEDURE Mouse6;
  350.  
  351. var
  352.   m6masks : array[0..1,0..15] of word;
  353.   Regs : Registers;
  354.  
  355. BEGIN
  356.  
  357. { Screen Mask }
  358.  
  359.   m6masks[0,0] := $F81F;    {1111100000011111}
  360.   m6masks[0,1] := $E007;    {1110000000000111}
  361.   m6masks[0,2] := $C003;    {1100000000000011}
  362.   m6masks[0,3] := $8001;    {1000000000000001}
  363.   m6masks[0,4] := $0000;    {0000000000000000}
  364.   m6masks[0,5] := $0000;    {0000000000000000}
  365.   m6masks[0,6] := $0000;    {0000000000000000}
  366.   m6masks[0,7] := $0000;    {0000000000000000}
  367.   m6masks[0,8] := $0000;    {0000000000000000}
  368.   m6masks[0,9] := $8001;    {1000000000000001}
  369.   m6masks[0,10] := $C003;   {1100000000000011}
  370.   m6masks[0,11] := $E007;   {1110000000000111}
  371.   m6masks[0,12] := $F81F;   {1111100000011111}
  372.   m6masks[0,13] := $FFFF;   {1111111111111111}
  373.   m6masks[0,14] := $FFFF;   {1111111111111111}
  374.   m6masks[0,15] := $FFFF;   {1111111111111111}
  375.  
  376. { Cursor Mask }
  377.  
  378.   m6masks[1,0] := $0000;    {0000000000000000}
  379.   m6masks[1,1] := $07E0;    {0000011111100000}
  380.   m6masks[1,2] := $1FF8;    {0001111111111000}
  381.   m6masks[1,3] := $3FFC;    {0011111111111100}
  382.   m6masks[1,4] := $7E7E;    {0111111001111110}
  383.   m6masks[1,5] := $7E7E;    {0111111001111110}
  384.   m6masks[1,6] := $7E7E;    {0111111001111110}
  385.   m6masks[1,7] := $7E7E;    {0111111001111110}
  386.   m6masks[1,8] := $7EFE;    {0111111011111110}
  387.   m6masks[1,9] := $3EFC;    {0011111011111100}
  388.   m6masks[1,10] := $1EF8;   {0001111011111000}
  389.   m6masks[1,11] := $06E0;   {0000011011100000}
  390.   m6masks[1,12] := $0000;   {0000000000000000}
  391.   m6masks[1,13] := $0000;   {0000000000000000}
  392.   m6masks[1,14] := $0000;   {0000000000000000}
  393.   m6masks[1,15] := $0000;   {0000000000000000}
  394.   regs.AX := 9;
  395.   regs.BX := 1;
  396.   regs.CX := 0;
  397.   regs.DX := ofs(m6masks);
  398.   regs.ES := seg(m6masks);
  399.   Intr(51,Regs);
  400. end;
  401.  
  402. {--------------------------------------------------------------------------}
  403.  
  404. PROCEDURE Mouse7;
  405.  
  406. var
  407.   m7masks : array[0..1,0..15] of word;
  408.   Regs : Registers;
  409.  
  410. BEGIN
  411.  
  412. { Screen Mask }
  413.  
  414.   m7masks[0,0] := $F81F;    {1111100000011111}
  415.   m7masks[0,1] := $E007;    {1110000000000111}
  416.   m7masks[0,2] := $C003;    {1100000000000011}
  417.   m7masks[0,3] := $8001;    {1000000000000001}
  418.   m7masks[0,4] := $0000;    {0000000000000000}
  419.   m7masks[0,5] := $0000;    {0000000000000000}
  420.   m7masks[0,6] := $0000;    {0000000000000000}
  421.   m7masks[0,7] := $0000;    {0000000000000000}
  422.   m7masks[0,8] := $0000;    {0000000000000000}
  423.   m7masks[0,9] := $8001;    {1000000000000001}
  424.   m7masks[0,10] := $C003;   {1100000000000011}
  425.   m7masks[0,11] := $E007;   {1110000000000111}
  426.   m7masks[0,12] := $F81F;   {1111100000011111}
  427.   m7masks[0,13] := $FFFF;   {1111111111111111}
  428.   m7masks[0,14] := $FFFF;   {1111111111111111}
  429.   m7masks[0,15] := $FFFF;   {1111111111111111}
  430.  
  431. { Cursor Mask }
  432.  
  433.   m7masks[1,0] := $0000;    {0000000000000000}
  434.   m7masks[1,1] := $07E0;    {0000011111100000}
  435.   m7masks[1,2] := $1FF8;    {0001111111111000}
  436.   m7masks[1,3] := $3FFC;    {0011111111111100}
  437.   m7masks[1,4] := $7E7E;    {0111111001111110}
  438.   m7masks[1,5] := $7E7E;    {0111111001111110}
  439.   m7masks[1,6] := $7E7E;    {0111111001111110}
  440.   m7masks[1,7] := $7E7E;    {0111111001111110}
  441.   m7masks[1,8] := $7DFE;    {0111110111111110}
  442.   m7masks[1,9] := $3BFC;    {0011101111111100}
  443.   m7masks[1,10] := $1BF8;   {0001101111111000}
  444.   m7masks[1,11] := $07E0;   {0000011111100000}
  445.   m7masks[1,12] := $0000;   {0000000000000000}
  446.   m7masks[1,13] := $0000;   {0000000000000000}
  447.   m7masks[1,14] := $0000;   {0000000000000000}
  448.   m7masks[1,15] := $0000;   {0000000000000000}
  449.   regs.AX := 9;
  450.   regs.BX := 1;
  451.   regs.CX := 0;
  452.   regs.DX := ofs(m7masks);
  453.   regs.ES := seg(m7masks);
  454.   Intr(51,Regs);
  455. end;
  456.  
  457. {--------------------------------------------------------------------------}
  458.  
  459. PROCEDURE Mouse8;
  460.  
  461. var
  462.   m8masks : array[0..1,0..15] of word;
  463.   Regs : Registers;
  464.  
  465. BEGIN
  466.  
  467. { Screen Mask }
  468.  
  469.   m8masks[0,0] := $F81F;    {1111100000011111}
  470.   m8masks[0,1] := $E007;    {1110000000000111}
  471.   m8masks[0,2] := $C003;    {1100000000000011}
  472.   m8masks[0,3] := $8001;    {1000000000000001}
  473.   m8masks[0,4] := $0000;    {0000000000000000}
  474.   m8masks[0,5] := $0000;    {0000000000000000}
  475.   m8masks[0,6] := $0000;    {0000000000000000}
  476.   m8masks[0,7] := $0000;    {0000000000000000}
  477.   m8masks[0,8] := $0000;    {0000000000000000}
  478.   m8masks[0,9] := $8001;    {1000000000000001}
  479.   m8masks[0,10] := $C003;   {1100000000000011}
  480.   m8masks[0,11] := $E007;   {1110000000000111}
  481.   m8masks[0,12] := $F81F;   {1111100000011111}
  482.   m8masks[0,13] := $FFFF;   {1111111111111111}
  483.   m8masks[0,14] := $FFFF;   {1111111111111111}
  484.   m8masks[0,15] := $FFFF;   {1111111111111111}
  485.  
  486. { Cursor Mask }
  487.  
  488.   m8masks[1,0] := $0000;    {0000000000000000}
  489.   m8masks[1,1] := $07E0;    {0000011111100000}
  490.   m8masks[1,2] := $1FF8;    {0001111111111000}
  491.   m8masks[1,3] := $3FFC;    {0011111111111100}
  492.   m8masks[1,4] := $7E7E;    {0111111001111110}
  493.   m8masks[1,5] := $7E7E;    {0111111001111110}
  494.   m8masks[1,6] := $7E7E;    {0111111001111110}
  495.   m8masks[1,7] := $787E;    {0111100001111110}
  496.   m8masks[1,8] := $67FE;    {0110011111111110}
  497.   m8masks[1,9] := $1FFC;    {0001111111111100}
  498.   m8masks[1,10] := $1FF8;   {0001111111111000}
  499.   m8masks[1,11] := $07E0;   {0000011111100000}
  500.   m8masks[1,12] := $0000;   {0000000000000000}
  501.   m8masks[1,13] := $0000;   {0000000000000000}
  502.   m8masks[1,14] := $0000;   {0000000000000000}
  503.   m8masks[1,15] := $0000;   {0000000000000000}
  504.   regs.AX := 9;
  505.   regs.BX := 1;
  506.   regs.CX := 0;
  507.   regs.DX := ofs(m8masks);
  508.   regs.ES := seg(m8masks);
  509.   Intr(51,Regs);
  510. end;
  511.  
  512. {--------------------------------------------------------------------------}
  513.  
  514. PROCEDURE Mouse9;
  515.  
  516. var
  517.   m9masks : array[0..1,0..15] of word;
  518.   Regs : Registers;
  519.  
  520. BEGIN
  521.  
  522. { Screen Mask }
  523.  
  524.   m9masks[0,0] := $F81F;    {1111100000011111}
  525.   m9masks[0,1] := $E007;    {1110000000000111}
  526.   m9masks[0,2] := $C003;    {1100000000000011}
  527.   m9masks[0,3] := $8001;    {1000000000000001}
  528.   m9masks[0,4] := $0000;    {0000000000000000}
  529.   m9masks[0,5] := $0000;    {0000000000000000}
  530.   m9masks[0,6] := $0000;    {0000000000000000}
  531.   m9masks[0,7] := $0000;    {0000000000000000}
  532.   m9masks[0,8] := $0000;    {0000000000000000}
  533.   m9masks[0,9] := $8001;    {1000000000000001}
  534.   m9masks[0,10] := $C003;   {1100000000000011}
  535.   m9masks[0,11] := $E007;   {1110000000000111}
  536.   m9masks[0,12] := $F81F;   {1111100000011111}
  537.   m9masks[0,13] := $FFFF;   {1111111111111111}
  538.   m9masks[0,14] := $FFFF;   {1111111111111111}
  539.   m9masks[0,15] := $FFFF;   {1111111111111111}
  540.  
  541. { Cursor Mask }
  542.  
  543.   m9masks[1,0] := $0000;    {0000000000000000}
  544.   m9masks[1,1] := $07E0;    {0000011111100000}
  545.   m9masks[1,2] := $1FF8;    {0001111111111000}
  546.   m9masks[1,3] := $3FFC;    {0011111111111100}
  547.   m9masks[1,4] := $7E7E;    {0111111001111110}
  548.   m9masks[1,5] := $7E7E;    {0111111001111110}
  549.   m9masks[1,6] := $007E;    {0000000001111110}
  550.   m9masks[1,7] := $7E7E;    {0111111001111110}
  551.   m9masks[1,8] := $7FFE;    {0111111111111110}
  552.   m9masks[1,9] := $3FFC;    {0011111111111100}
  553.   m9masks[1,10] := $1FF8;   {0001111111111000}
  554.   m9masks[1,11] := $07E0;   {0000011111100000}
  555.   m9masks[1,12] := $0000;   {0000000000000000}
  556.   m9masks[1,13] := $0000;   {0000000000000000}
  557.   m9masks[1,14] := $0000;   {0000000000000000}
  558.   m9masks[1,15] := $0000;   {0000000000000000}
  559.   regs.AX := 9;
  560.   regs.BX := 1;
  561.   regs.CX := 0;
  562.   regs.DX := ofs(m9masks);
  563.   regs.ES := seg(m9masks);
  564.   Intr(51,Regs);
  565. end;
  566.  
  567. {--------------------------------------------------------------------------}
  568.  
  569. PROCEDURE Mouse10;
  570.  
  571. var
  572.   m10masks : array[0..1,0..15] of word;
  573.   Regs : Registers;
  574.  
  575. BEGIN
  576.  
  577. { Screen Mask }
  578.  
  579.   m10masks[0,0] := $F81F;    {1111100000011111}
  580.   m10masks[0,1] := $E007;    {1110000000000111}
  581.   m10masks[0,2] := $C003;    {1100000000000011}
  582.   m10masks[0,3] := $8001;    {1000000000000001}
  583.   m10masks[0,4] := $0000;    {0000000000000000}
  584.   m10masks[0,5] := $0000;    {0000000000000000}
  585.   m10masks[0,6] := $0000;    {0000000000000000}
  586.   m10masks[0,7] := $0000;    {0000000000000000}
  587.   m10masks[0,8] := $0000;    {0000000000000000}
  588.   m10masks[0,9] := $8001;    {1000000000000001}
  589.   m10masks[0,10] := $C003;   {1100000000000011}
  590.   m10masks[0,11] := $E007;   {1110000000000111}
  591.   m10masks[0,12] := $F81F;   {1111100000011111}
  592.   m10masks[0,13] := $FFFF;   {1111111111111111}
  593.   m10masks[0,14] := $FFFF;   {1111111111111111}
  594.   m10masks[0,15] := $FFFF;   {1111111111111111}
  595.  
  596. { Cursor Mask }
  597.  
  598.   m10masks[1,0] := $0000;    {0000000000000000}
  599.   m10masks[1,1] := $07E0;    {0000011111100000}
  600.   m10masks[1,2] := $1FF8;    {0001111111111000}
  601.   m10masks[1,3] := $1FFC;    {0001111111111100}
  602.   m10masks[1,4] := $667E;    {0110011001111110}
  603.   m10masks[1,5] := $7A7E;    {0111101001111110}
  604.   m10masks[1,6] := $7C7E;    {0111110001111110}
  605.   m10masks[1,7] := $7E7E;    {0111111001111110}
  606.   m10masks[1,8] := $7FFE;    {0111111111111110}
  607.   m10masks[1,9] := $3FFC;    {0011111111111100}
  608.   m10masks[1,10] := $1FF8;   {0001111111111000}
  609.   m10masks[1,11] := $07E0;   {0000011111100000}
  610.   m10masks[1,12] := $0000;   {0000000000000000}
  611.   m10masks[1,13] := $0000;   {0000000000000000}
  612.   m10masks[1,14] := $0000;   {0000000000000000}
  613.   m10masks[1,15] := $0000;   {0000000000000000}
  614.   regs.AX := 9;
  615.   regs.BX := 1;
  616.   regs.CX := 0;
  617.   regs.DX := ofs(m10masks);
  618.   regs.ES := seg(m10masks);
  619.   Intr(51,Regs);
  620. end;
  621.  
  622. {--------------------------------------------------------------------------}
  623.  
  624. PROCEDURE Mouse11;
  625.  
  626. var
  627.   m11masks : array[0..1,0..15] of word;
  628.   Regs : Registers;
  629.  
  630. BEGIN
  631.  
  632. { Screen Mask }
  633.  
  634.   m11masks[0,0] := $F81F;    {1111100000011111}
  635.   m11masks[0,1] := $E007;    {1110000000000111}
  636.   m11masks[0,2] := $C003;    {1100000000000011}
  637.   m11masks[0,3] := $8001;    {1000000000000001}
  638.   m11masks[0,4] := $0000;    {0000000000000000}
  639.   m11masks[0,5] := $0000;    {0000000000000000}
  640.   m11masks[0,6] := $0000;    {0000000000000000}
  641.   m11masks[0,7] := $0000;    {0000000000000000}
  642.   m11masks[0,8] := $0000;    {0000000000000000}
  643.   m11masks[0,9] := $8001;    {1000000000000001}
  644.   m11masks[0,10] := $C003;   {1100000000000011}
  645.   m11masks[0,11] := $E007;   {1110000000000111}
  646.   m11masks[0,12] := $F81F;   {1111100000011111}
  647.   m11masks[0,13] := $FFFF;   {1111111111111111}
  648.   m11masks[0,14] := $FFFF;   {1111111111111111}
  649.   m11masks[0,15] := $FFFF;   {1111111111111111}
  650.  
  651. { Cursor Mask }
  652.  
  653.   m11masks[1,0] := $0000;    {0000000000000000}
  654.   m11masks[1,1] := $07E0;    {0000011111100000}
  655.   m11masks[1,2] := $1BF8;    {0001101111111000}
  656.   m11masks[1,3] := $3BFC;    {0011101111111100}
  657.   m11masks[1,4] := $7C7E;    {0111110001111110}
  658.   m11masks[1,5] := $7C7E;    {0111110001111110}
  659.   m11masks[1,6] := $7E7E;    {0111111001111110}
  660.   m11masks[1,7] := $7E7E;    {0111111001111110}
  661.   m11masks[1,8] := $7FFE;    {0111111111111110}
  662.   m11masks[1,9] := $3FFC;    {0011111111111100}
  663.   m11masks[1,10] := $1FF8;   {0001111111111000}
  664.   m11masks[1,11] := $07E0;   {0000011111100000}
  665.   m11masks[1,12] := $0000;   {0000000000000000}
  666.   m11masks[1,13] := $0000;   {0000000000000000}
  667.   m11masks[1,14] := $0000;   {0000000000000000}
  668.   m11masks[1,15] := $0000;   {0000000000000000}
  669.   regs.AX := 9;
  670.   regs.BX := 1;
  671.   regs.CX := 0;
  672.   regs.DX := ofs(m11masks);
  673.   regs.ES := seg(m11masks);
  674.   Intr(51,Regs);
  675. end;
  676.  
  677. {--------------------------------------------------------------------------}
  678.  
  679. PROCEDURE Mouse12;
  680.  
  681. var
  682.   m12masks : array[0..1,0..15] of word;
  683.   Regs : Registers;
  684.  
  685. BEGIN
  686.  
  687. { Screen Mask }
  688.  
  689.   m12masks[0,0] := $F81F;    {1111100000011111}
  690.   m12masks[0,1] := $E007;    {1110000000000111}
  691.   m12masks[0,2] := $C003;    {1100000000000011}
  692.   m12masks[0,3] := $8001;    {1000000000000001}
  693.   m12masks[0,4] := $0000;    {0000000000000000}
  694.   m12masks[0,5] := $0000;    {0000000000000000}
  695.   m12masks[0,6] := $0000;    {0000000000000000}
  696.   m12masks[0,7] := $0000;    {0000000000000000}
  697.   m12masks[0,8] := $0000;    {0000000000000000}
  698.   m12masks[0,9] := $8001;    {1000000000000001}
  699.   m12masks[0,10] := $C003;   {1100000000000011}
  700.   m12masks[0,11] := $E007;   {1110000000000111}
  701.   m12masks[0,12] := $F81F;   {1111100000011111}
  702.   m12masks[0,13] := $FFFF;   {1111111111111111}
  703.   m12masks[0,14] := $FFFF;   {1111111111111111}
  704.   m12masks[0,15] := $FFFF;   {1111111111111111}
  705.  
  706. { Cursor Mask }
  707.  
  708.   m12masks[1,0] := $0000;    {0000000000000000}
  709.   m12masks[1,1] := $0760;    {0000011101100000}
  710.   m12masks[1,2] := $1F78;    {0001111101111000}
  711.   m12masks[1,3] := $3F7C;    {0011111101111100}
  712.   m12masks[1,4] := $7E7E;    {0111111001111110}
  713.   m12masks[1,5] := $7E7E;    {0111111001111110}
  714.   m12masks[1,6] := $7E7E;    {0111111001111110}
  715.   m12masks[1,7] := $7E7E;    {0111111001111110}
  716.   m12masks[1,8] := $7FFE;    {0111111111111110}
  717.   m12masks[1,9] := $3FFC;    {0011111111111100}
  718.   m12masks[1,10] := $1FF8;   {0001111111111000}
  719.   m12masks[1,11] := $07E0;   {0000011111100000}
  720.   m12masks[1,12] := $0000;   {0000000000000000}
  721.   m12masks[1,13] := $0000;   {0000000000000000}
  722.   m12masks[1,14] := $0000;   {0000000000000000}
  723.   m12masks[1,15] := $0000;   {0000000000000000}
  724.   regs.AX := 9;
  725.   regs.BX := 1;
  726.   regs.CX := 0;
  727.   regs.DX := ofs(m12masks);
  728.   regs.ES := seg(m12masks);
  729.   Intr(51,Regs);
  730. end;
  731.  
  732. {--------------------------------------------------------------------------}
  733.  
  734. function EGAthere: boolean;
  735.  
  736. begin
  737.   detectgraph(sysgraphadapter, sysgraphmode);
  738.   if sysgraphadapter = 3 or 9 then EGAthere := true;
  739. end;
  740.  
  741. {--------------------------------------------------------------------------}
  742.  
  743. { These procedures link the EGAVGA.BGI driver into the EXE file. }
  744.  
  745. procedure egavgadriver; external;
  746. {$L D:\TP\EGAVGA.OBJ}     { This is the directory where I keep the
  747.                             object version of the EGAVGA.BGI driver.}
  748.  
  749.  
  750. procedure RegisterEGAVGA;
  751.  
  752. begin
  753.   if RegisterBGIDriver(@egavgadriver) < 0 then
  754.   begin
  755.     writeln('Error registering driver:',Grapherrormsg(graphresult));
  756.     readln;
  757.     Halt(1);
  758.   end;
  759. end;
  760.  
  761. {--------------------------------------------------------------------------}
  762.  
  763. procedure initega;
  764.  
  765. { Initializes EGA 640x350x16 graphics if an EGA or VGA card is detected. }
  766.  
  767. var
  768.   grapherror : integer;
  769.  
  770. begin
  771.   if EGAthere then
  772.   begin
  773.     graphdriver := 3;
  774.     graphmode := 1;
  775.     initgraph(graphdriver, Graphmode,'D:\TP');
  776.     Grapherror := graphresult;
  777.     if grapherror <> 0 then
  778.     begin
  779.       writeln('Error initializing graphics:',Grapherrormsg(grapherror));
  780.       halt(1);
  781.     end;
  782.   end;
  783. end;
  784.  
  785. {--------------------------------------------------------------------------}
  786.  
  787. PROCEDURE CheckForMouse;
  788.  
  789. BEGIN
  790.   x1 := wherex;
  791.   y1 := wherey;
  792.   writeln(' Checking for mouse...');
  793.   delay(1000);
  794.   If not MouseIsInstalled then
  795.     begin
  796.       writeln(' This demo requires a mouse.');
  797.       writeln(' No mouse driver could be detected.');
  798.       halt(2);
  799.     end
  800.     else
  801.     begin
  802.       gotoxy(x1,y1);
  803.       clreol;
  804.       writeln(' A mouse is installed.');
  805.       delay(1000);
  806.     end;
  807.   writeln;
  808. end;
  809.  
  810. {--------------------------------------------------------------------------}
  811.  
  812. PROCEDURE CheckForEGA;
  813.  
  814. BEGIN
  815.   x1 := wherex;
  816.   y1 := wherey;
  817.   writeln(' Checking for EGA...');
  818.   delay(1000);                { the delay is just to give the user }
  819.   If not EGAthere then        { time to read the screen }
  820.     begin
  821.       writeln(' This demo requires EGA 640x350x16 graphics.');
  822.       writeln(' EGA or capatible graphics could not be detected.');
  823.       halt(2);
  824.     end
  825.     else
  826.     begin
  827.       gotoxy(x1,y1);
  828.       clreol;
  829.       writeln(' EGA is installed.');
  830.       delay(1000);
  831.     end;
  832.   writeln;
  833. end;
  834.  
  835. {--------------------------------------------------------------------------}
  836.  
  837. Procedure drawcb;    { Draws the grapfic 'Continue' button. }
  838.  
  839. begin
  840.   setfillstyle(1,ltgray);
  841.   bar(282,327,358,338);
  842.   setcolor(white);
  843.   moveto(280,340);
  844.   lineto(280,325);
  845.   lineto(360,325);
  846.   setcolor(black);
  847.   moveto(360,326);
  848.   lineto(360,340);
  849.   lineto(282,340);
  850.   moveto(279,341);
  851.   lineto(279,324);
  852.   lineto(361,324);
  853.   setcolor(white);
  854.   moveto(361,325);
  855.   lineto(361,341);
  856.   lineto(280,341);
  857.   setcolor(black);
  858.   settextstyle(2,0,4);
  859.   settextjustify(1,1);
  860.   outtextxy(320,331,'Continue');
  861. end;
  862.  
  863. {--------------------------------------------------------------------------}
  864.  
  865. Procedure presscb;   { 'Lights' the graphic continue button when 'pressed'.}
  866.  
  867. begin
  868.   setfillstyle(1,white);
  869.   setcolor(black);
  870.   settextstyle(2,0,4);
  871.   settextjustify(1,1);
  872.   hidemouse;
  873.   bar(282,327,358,338);
  874.   outtextxy(320,331,'Continue');
  875.   showmouse;
  876.   delay(500);
  877.   setfillstyle(1,ltgray);
  878.   hidemouse;
  879.   bar(279,324,361,342);
  880.   showmouse;
  881. end;
  882.  
  883. {--------------------------------------------------------------------------}
  884.  
  885. Procedure Beep;
  886.  
  887. begin
  888.   sound(mx);
  889.   delay(100);
  890.   sound(my);
  891.   delay(100);
  892.   nosound;
  893. end;
  894.  
  895. {--------------------------------------------------------------------------}
  896.  
  897. Procedure FlushKey;              { Clears any key strokes in the key-  }
  898.                                  { board buffer so a couple of key     }
  899. var                              { presses don't race you through program. }
  900.   Regs : Registers;
  901.  
  902. begin
  903.   Regs.AH := $01;  { AH=1: Check for keystroke }
  904.   Intr($16,regs); { Interupt $16: Keyboard services}
  905.   IF (regs.Flags and $0040) = 0 then { if chars in buffer }
  906.     REPEAT
  907.       Regs.AH := 0;
  908.       Intr($16,Regs);
  909.       Regs.AH := $01;
  910.       Intr($16,Regs);
  911.     Until (regs.flags and $0040) <> 0;
  912. end;
  913.  
  914. {--------------------------------------------------------------------------}
  915.  
  916. Procedure Wait;    { Waits for keypress or mouse click. }
  917.  
  918. begin
  919.   continue := false;
  920.   flushkey;
  921.   Repeat
  922.   if keypressed then
  923.     begin
  924.       ch := readkey;
  925.       presscb;
  926.       continue := true;
  927.     end
  928.   else
  929.   pollmouse(mx,my,lb,rb,bb);
  930.   if lb then
  931.     begin
  932.       case my of
  933.         326..339 :
  934.           begin
  935.             case mx of
  936.               281..357 : begin
  937.                            presscb;
  938.                            continue := true;
  939.                          end;
  940.               else beep;  { Two tone beep based on mouse position. }
  941.  
  942.             end; {case mx}
  943.           end;
  944.               else beep;
  945.        end; {case my}
  946.      end;
  947.    until continue;
  948.   settextjustify(0,1);
  949. end;
  950.  
  951. {--------------------------------------------------------------------------}
  952.  
  953. Procedure TMContinue;  { Text mode button flash. }
  954.  
  955. begin
  956.   window(1,1,80,24);
  957.   gotoxy(37,24);
  958.   textcolor(15);
  959.   hidemouse;
  960.   write('Continue');
  961.   textcolor(0);
  962.   showmouse;
  963.   delay(500);
  964.   hidemouse;
  965.   gotoxy(37,24);
  966.   write('Continue');
  967.   showmouse;
  968.   window(1,5,80,22);
  969.   showmouse;
  970.   continue := true;
  971. end;
  972.  
  973. {--------------------------------------------------------------------------}
  974.  
  975. Procedure TMWait;    { Text mode Wait. }
  976.  
  977. begin
  978.   continue := false;
  979.   flushkey;
  980.   repeat
  981.     if keypressed then
  982.       begin
  983.         ch := readkey;
  984.         TMContinue;
  985.       end
  986.     else
  987.     pollmouse(mx,my,lb,rb,bb);
  988.     if lb then
  989.     begin
  990.       case my of
  991.         184 :
  992.           begin
  993.             case mx of
  994.               280..360 : TMContinue;
  995.               else beep;
  996.             end; {case mx}
  997.           end;
  998.               else beep;
  999.        end; {case my}
  1000.      end;
  1001.   until continue;
  1002. end;
  1003.  
  1004. {--------------------------------------------------------------------------}
  1005.  
  1006. Procedure writeTextTitle;
  1007.  
  1008. begin
  1009.   writeln('                                                                               ');
  1010.   writeln(' ',title,'             ');
  1011.   writeln('                                                                               ');
  1012.  
  1013. end;
  1014.  
  1015. {--------------------------------------------------------------------------}
  1016.  
  1017.  
  1018. BEGIN
  1019.   clrscr;
  1020.   textbackground(7);
  1021.   textcolor(0);
  1022.   writetexttitle;
  1023.   textbackground(0);
  1024.   textcolor(7);
  1025.   checkformouse;
  1026.   gotoxy(1,4);
  1027.   clreol;
  1028.   checkforega;
  1029.   gotoxy(1,4);
  1030.   clreol;
  1031.   clrscr;
  1032.   textbackground(7);
  1033.   textcolor(0);
  1034.   clrscr;
  1035.   writetexttitle;
  1036.   exitsave := exitproc;          { Saves current exit procedure. }
  1037.   exitproc := @mcedemoexit;      { Installs my exit procedure. }
  1038.   registeregavga;
  1039.  
  1040. { Screen 1 }
  1041.  
  1042.   gotoxy(35,23);
  1043.   write('╔══════════╗');
  1044.   gotoxy(35,24);
  1045.   write('║ Continue ║');
  1046.   gotoxy(35,25);
  1047.   write('╚══════════╝');
  1048.   window(1,5,80,22);
  1049.   writeln(' This demo will show you some of the things you can do with a mouse.');
  1050.   writeln(' I apologize for the sloppy code, but it works.');
  1051.   writeln;
  1052.   writeln(' Brand and product names mentioned are trademarks or registered trademarks');
  1053.   writeln(' of their respective holders.');
  1054.   writeln;
  1055.   writeln(' To continue, click on the continue button, or press any key.');
  1056.   mousereset;
  1057.   showmouse;
  1058.   tmwait;
  1059.   hidemouse;
  1060.   clrscr;
  1061.  
  1062. { Screen 2 }
  1063.  
  1064.   gotoxy(1,1);
  1065.   writeln('      MOUSE CURSOR EDITOR (MCEDIT) is designed to make it easier to write');
  1066.   writeln(' programs that use a mouse.  MCEDIT is a graphical mouse cursor editor.  You');
  1067.   writeln(' draw the cursor that you want and MCEDIT writes the code for the screen and');
  1068.   writeln(' cursor masks required to display that mouse cursor.  Version 1.0 can output');
  1069.   writeln(' the code as a Pascal procedure, in hex, in binary, or hex and binary.  If you');
  1070.   writeln(' have ever created a mouse cursor by hand, yoy will appreciate this program.');
  1071.   writeln(' MCEDIT was written with Turbo Pascal 5.0.');
  1072.   writeln;
  1073.   writeln('      The unit that included with MCEDIT contains procedures and functions');
  1074.   writeln(' for using a mouse in Turbo Pascal.  The unit (BOBMOUSE.TPU) was written and');
  1075.   writeln(' compiled in TP 5.0, but I''m sure they could be adapted for newer versions.');
  1076.   writeln(' The procedures and functions in the unit are based on ones from a variety of');
  1077.   writeln(' sources, including Jeff Duntemann''s book "Complete Turbo Pascal, Third');
  1078.   writeln(' Edition" published by Scott, Foresman and Company, and the "Microsoft Mouse');
  1079.   writeln(' Programmer''s Referance", Microsoft Press.  I highly recommend both books.');
  1080.   showmouse;
  1081.   tmwait;
  1082.   clrscr;
  1083.  
  1084. { Screen 3 }
  1085.  
  1086.   gotoxy(1,1);
  1087.   writeln(' Procedures and functions in the unit can provide the user and or the program');
  1088.   writeln(' with some information about the mouse and mouse driver on the computer.');
  1089.   writeln;
  1090.   writeln(' Here is some information about the mouse and mouse driver on this system.');
  1091.   writeln;
  1092.   writeln(' Mouse driver version : ',getmouseversion);
  1093.   writeln(' Mouse type           : ',getmousetype);
  1094.   writeln(' Mouse IRQ            : ',getmouseIRQ);
  1095.   writeln(' Number of buttons    : ',getnumberofmousebuttons);
  1096.   write(' Mouse cursor position: ');
  1097.   mousereset;
  1098.   showmouse;
  1099.   x1 := wherex;
  1100.   y1 := wherey;
  1101.   flushkey;
  1102.   continue := false;
  1103.   repeat
  1104.     if keypressed then
  1105.       begin
  1106.         ch := readkey;
  1107.         TMContinue;
  1108.       end
  1109.     else
  1110.     pollmouse(mx,my,lb,rb,bb);
  1111.     hidemouse;
  1112.     gotoxy(x1,y1);
  1113.     clreol;
  1114.     write('(',mx div 8 + 1,',',my div 8 + 1,')');
  1115.     showmouse;
  1116.     delay(100);
  1117.     if lb then
  1118.     begin
  1119.       case my of
  1120.         184 :
  1121.           begin
  1122.             case mx of
  1123.               280..360 : TMContinue;
  1124.               else beep;
  1125.  
  1126.             end; {case mx}
  1127.           end;
  1128.               else beep;
  1129.        end; {case my}
  1130.      end;
  1131.   until continue;
  1132.   hidemouse;
  1133.   clrscr;
  1134.   gotoxy(30,10);
  1135.   writeln('Time for graphics mode...');
  1136.   showmouse;
  1137.   delay(1000);
  1138.   hidemouse;
  1139.  
  1140. { GRAPHICS MODE }
  1141.  
  1142.   Initega;
  1143.   black := 1;
  1144.   setpalette(1,0);
  1145.   setpalette(14,63);   { so the inverse to black is OK }
  1146.   white := 2;
  1147.   setpalette(2,63);
  1148.   ltgray := 7;
  1149.   dkgray := 8;
  1150.   ltgreen := 10;
  1151.   setfillstyle(1,ltgray);
  1152.   bar(0,0,getmaxx,getmaxy);
  1153.   settextjustify(0,2);
  1154.   settextstyle(2,0,4);
  1155.   setcolor(black);
  1156.   outtextxy(11,3,title);
  1157.   outtextxy(235,180,'... and some fun with the mouse.');
  1158.   delay(1500);
  1159.   bar(235,180,420,190);
  1160.   settextjustify(0,1);
  1161.   outtextxy(11,33,'As you have previously seen, your program can use a number of mouse function calls to get information');
  1162.   outtextxy(11,43,'from the mousedriver about the mouse.  Your program can also use mouse function calls to control the');
  1163.   outtextxy(11,53,'mouse.');
  1164.   drawcb;
  1165.   mousereset;
  1166.   showmouse;
  1167.   wait;
  1168.   hidemouse;     { Each time you draw to the screen it is a good idea to }
  1169.                  { hide the mouse, because of the why the mouse driver works }
  1170.                  { with video memory. }
  1171.   Outtextxy(11,73,'You can hide the mouse...');
  1172.   showmouse;
  1173.   delay(500);
  1174.   pollmouse(mx,my,lb,rb,bb);
  1175.   hidemouse;
  1176.   outtextxy(mx-40,my-10,'Now you see it...');
  1177.   showmouse;
  1178.   delay(500);
  1179.   hidemouse;
  1180.   outtextxy(mx-40,my+10,'Now you don''t!');
  1181.   delay(3000);
  1182.   bar(mx-50,my-12,mx+60,my+20);
  1183.   drawcb;
  1184.   showmouse;
  1185.   wait;
  1186.  
  1187.  
  1188.   hidemouse;
  1189.   Outtextxy(11,83,'You can move the mouse...');
  1190.   showmouse;
  1191.   for i := 1 to 10 do
  1192.   begin
  1193.     mx := random(319);
  1194.     my := random(174);
  1195.     MouseToXY(160+mx,86+my);
  1196.     delay(500);
  1197.   end;
  1198.   MouseToXY(20,170);
  1199.   for I := 21 to 620 do
  1200.   begin
  1201.     MouseToXY(I,170);
  1202.   end;
  1203.   hidemouse;
  1204.   Outtextxy(11,93,'Moving the mouse should be used sparingly because it can mentally disrupt the user/pointer connection.');
  1205.   drawcb;
  1206.   showmouse;
  1207.   wait;
  1208.  
  1209.  
  1210.   hidemouse;
  1211.   bar(11,90,639,102);
  1212.   Outtextxy(11,93,'You can limit the area the mouse can move in...');
  1213.   showmouse;
  1214.   MouseToXY(400,200);
  1215.   SetColumnRange(351,449);
  1216.   SetRowRange(151,249);
  1217.   for x := 350 to 450 do
  1218.     begin
  1219.       conditionaloff(x-16,134,x+16,166);
  1220.       putpixel(x,150,ltGreen);
  1221.       showmouse;
  1222.       delay(2);
  1223.     end;
  1224.   for y := 150 to 250 do
  1225.     begin
  1226.       conditionaloff(434,y-16,466,y+16);
  1227.       putpixel(450,y,ltGreen);
  1228.       showmouse;
  1229.       delay(2);
  1230.     end;
  1231.   for x := 450 downto 350 do
  1232.     begin
  1233.       conditionaloff(x-16,234,x+16,266);
  1234.       putpixel(x,250,ltGreen);
  1235.       showmouse;
  1236.       delay(2);
  1237.     end;
  1238.   for y := 250 downto 150 do
  1239.     begin
  1240.       conditionaloff(334,y-16,366,y+16);
  1241.       putpixel(350,y,ltGreen);
  1242.       showmouse;
  1243.       delay(2);
  1244.     end;
  1245.   OutTextXY(250,258,'The mouse will not be able to leave the rectangle.');
  1246.   OutTextXY(300,268,'(press the right button to continue)');
  1247.   continue := false;
  1248.   repeat
  1249.     pollmouse(mx,my,lb,rb,bb);
  1250.     if rb then continue := true
  1251.   until continue;
  1252.   SetColumnRange(0,639);
  1253.   SetRowRange(0,349);
  1254.  
  1255.  
  1256.   hidemouse;
  1257.   bar(250,150,639,277);
  1258.   Outtextxy(11,103,'And, of coarse, you can change the shape of the mouse cursor.  This is why I wrote MCEDIT.');
  1259.   drawcb;
  1260.   showmouse;
  1261.   wait;
  1262.   hidemouse;
  1263.   Outtextxy(11,113,'Your mouse cursor could...');
  1264.   Outtextxy(41,123,'become the ''evil anti-mouse'',');
  1265.   drawcb;
  1266.   blackmouse;
  1267.   showmouse;
  1268.   wait;
  1269.   hidemouse;
  1270.   Outtextxy(41,133,'let the user know they will have to wait,');
  1271.   watchmouse;
  1272.   drawcb;
  1273.   showmouse;
  1274.   wait;
  1275.   hourglasmouse;
  1276.   hidemouse;
  1277.   drawcb;
  1278.   showmouse;
  1279.   wait;
  1280.   hidemouse;
  1281.   Outtextxy(41,143,'change to pointer to suit your style,');
  1282.   handmouse;
  1283.   drawcb;
  1284.   showmouse;
  1285.   wait;
  1286.   hidemouse;
  1287.   Outtextxy(41,153,'or to indicate the use of a certain accessory, like a hand scanner,');
  1288.   handscanmouse;
  1289.   drawcb;
  1290.   showmouse;
  1291.   wait;
  1292.   hidemouse;
  1293.   Outtextxy(41,163,'or to indicate an operation like resizing a window or object on the screen,');
  1294.   horsizemouse;
  1295.   drawcb;
  1296.   showmouse;
  1297.   wait;
  1298.   hidemouse;
  1299.   drawcb;
  1300.   vertsizemouse;
  1301.   showmouse;
  1302.   drawcb;
  1303.   wait;
  1304.   hidemouse;
  1305.   Outtextxy(41,173,'or the use of a tool,');
  1306.   texttmouse;
  1307.   drawcb;
  1308.   showmouse;
  1309.   wait;
  1310.   hidemouse;
  1311.   Outtextxy(41,183,'or zooming.');
  1312.   magglassmouse;
  1313.   drawcb;
  1314.   showmouse;
  1315.   wait;
  1316.   hidemouse;
  1317.   Outtextxy(11,193,'Your cursor can take on almost any shape.');
  1318.   defaultmouse;
  1319.   drawcb;
  1320.   showmouse;
  1321.   wait;
  1322.  
  1323.   hidemouse;
  1324.   Outtextxy(11,203,'You can also animate the cursor...');
  1325.   showmouse;
  1326.   d:=50;
  1327.   for i := 1 to 10 do
  1328.     begin
  1329.       mouse1;
  1330.       delay(d);
  1331.       mouse2;
  1332.       delay(d);
  1333.       mouse3;
  1334.       delay(d);
  1335.       mouse4;
  1336.       delay(d);
  1337.       mouse5;
  1338.       delay(d);
  1339.       mouse6;
  1340.       delay(d);
  1341.       mouse7;
  1342.       delay(d);
  1343.       mouse8;
  1344.       delay(d);
  1345.       mouse9;
  1346.       delay(d);
  1347.       mouse10;
  1348.       delay(d);
  1349.       mouse11;
  1350.       delay(d);
  1351.       mouse12;
  1352.       delay(d);
  1353.     end;
  1354.  
  1355.   hidemouse;
  1356.   defaultmouse;
  1357.   Outtextxy(11,213,'The pixels that make up your mouse cursor will be either...');
  1358.   Outtextxy(41,223,'white,');
  1359.   drawcb;
  1360.   showmouse;
  1361.   wait;
  1362.   hidemouse;
  1363.   blackmouse;
  1364.   Outtextxy(41,233,'black,');
  1365.   drawcb;
  1366.   showmouse;
  1367.   wait;
  1368.   hidemouse;
  1369.   seethrghmouse;
  1370.   Outtextxy(41,243,'the under lying color,');
  1371.   drawcb;
  1372.   showmouse;
  1373.   wait;
  1374.   hidemouse;
  1375.   inversemouse;
  1376.   Outtextxy(41,253,'or inverse the under lying color.');
  1377.   drawcb;
  1378.   showmouse;
  1379.   wait;
  1380.  
  1381.   hidemouse;
  1382.   defaultmouse;
  1383.   Outtextxy(11,263,'And, with pallete manipulation, any color supported by the system.');
  1384.   drawcb;
  1385.   showmouse;
  1386.   wait;
  1387.   for i := 0 to 63 do
  1388.   begin
  1389.     setpalette(15,i);
  1390.     delay(d);
  1391.   end;
  1392.   hidemouse;
  1393.   drawcb;
  1394.   showmouse;
  1395.   wait;
  1396.  
  1397.   hidemouse;
  1398.   drawcb;
  1399.   settextjustify(0,1);
  1400.   Outtextxy(11,283,'I hope you find MCEDIT a useful tool.');
  1401.   Outtextxy(11,293,'Good luck with your programing,');
  1402.   bobsignp := @bobsign;
  1403.   putimage(200,293,bobsignp^,normalput);
  1404.   showmouse;
  1405.   wait;
  1406. END.
  1407.